package com.dayuanit.dy8.atm.springbootatm.config;

import com.dayuanit.dy8.atm.springbootatm.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class ATMWebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(new LoginInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/")
                .excludePathPatterns("/assets/**")
                .excludePathPatterns("/toLogin")
                .excludePathPatterns("/toRegist")
                .excludePathPatterns("/regist")
                .excludePathPatterns("/login")
                .excludePathPatterns("/wx/*")
                .excludePathPatterns("/getCaptcha");
    }
}
